#ifndef _TEST_H_
#define _TEST_H_

#include <crt_util.h>

typedef struct pipe_s pipe_t;

struct pipe_s {
    evoper_t* pipe;
    LPSTR addr;
    size_t len;
};

void test_msgq(void);
void test_cjson();

int mini_heap(void);
int test_rbtree(void);
int stdtest_func(void);

void test_ace(void);

void* loop_mem_alloc(evloop_t* loop, size_t count, size_t size);
int loop_mem_free(evloop_t* loop, void* ptr);

void* loop_alloc(void* ctx, size_t size);
int loop_free(void* ctx, void* ptr);
void* oper_alloc(void* ctx, size_t size);
int oper_free(void* ctx, void* ptr);

void test_oper_run();
void thread_proc1(void* ctx);
void thread_proc2(void* ctx);
void thread_proc3(void* ctx);
void thread_proc4(void* ctx);

void test_init_evaddr();
void test_timer(evloop_t* loop);
void test_conn_oper(evloop_t* loop);
void test_accept_oper(evloop_t* loop);

void test_write_oper(evloop_t* loop);
void test_read_oper(evloop_t* loop);

void test_array();

#endif
